<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统收发邮件</title>
    <link rel="stylesheet" type="text/css" href="<?=base_url()?>public/css/style.css">
    <script type="text/javascript" src="<?=base_url()?>public/js/jq.1.12.4.js"></script>
    <script type="text/javascript" src="<?=base_url()?>public/js/js.js"></script>
<style>
.person p span {
		width: 22% !important;
	}
</style>
<style type="text/css">
#page{height:32px;line-height:32px;margin-top:15px;margin-bottom:15px;text-align:left;}
#page a{background:#fff;border-radius:5px;float:left;display:block;padding:0 12px;line-height:32px;border:1px solid #ddd;margin-right:5px;font-size:12px;font-weight:bold;color:#444;}
#page a:hover{background:#f6f6f6}
#page a.cur{color:red;background:#444;border:1px solid #444;color:#fff;}
#page a.noborder{border:none;margin:0 2px;}
</style>
</head>
<body>
    <!-- 头部 -->
    <?php echo $menu ?>
    <!-- 主体 -->
    <div class="main clearfix">
        <?php echo $left ?>

		<div class="content">
			<div class="con">
				<div class="bikuang">
                	<div class="right_title"><span>联系我们&nbsp;&nbsp; -<span style="color:#1d3e00; margin:0;">&nbsp;&nbsp;邮件发送</span></span></div>
                    <div style="border-bottom:1px solid #c0cbb0; width:100%; margin:0 auto;box-shadow: -3px 3px 6px 0px rgba( 29, 62, 0, 0.2 ); padding-bottom:20px;">      
					<div class="person">
					<?php echo form_open('mail/message',array('id'=>'myform')); ?>
                    	<p><span>收件人邮箱</span><b>得道天合平台客服</b></p>
                        <p><span>邮件标题</span><input type="text" name="title" id="title" value=""><b class='bt'></b></p>
                        <p><span style="float:left">留言内容</span><textarea name="content" id="content"></textarea><b class='nr'></b></p>
                        <p class="btn"><input style="width:30%; background:#254e01; color:white;margin-left:40%; margin-top:10px; margin-left:40%;position:relative;" type="button" value="确认发送" id='send'></p>
                    </form>
                    </div>
                    </div>
                    <div class="right_title"><span>联系我们&nbsp;&nbsp; -<span style="color:#1d3e00; margin:0;">&nbsp;&nbsp;收件列表</span></span></div>
                    <div class="person3">
                    	<table cellpadding="0" cellspacing="0">
                        	<tr>
                            	<th>标题</th>
                                <th>内容</th>
                                <th>日期</th>
								<th>回复状态</th>
								<th>阅读状态</th>
                            </tr>
                            <?php 
                            foreach ($result as $rs){
                            ?>
                            <tr>
                            	<td><a href="mail_detail/index?id=<?php echo $rs['id'];?>"><?php echo $rs['message_title'];?></a></td>
                                <td><?php echo $rs['message_content'];?></td>
                                <td><?php echo date("Y-m-d",$rs['message_time']);?></td>
								<td><?php if($rs['reply_status']==1){echo "已回复";}else{echo "待回复";}?></td>
								<td><?php if($rs['read_status']==1){echo "已阅读";}else{echo "待阅读";}?></td>
                            </tr>
                            <?php }?>
                        </table>
                        <?php echo $multi;?>
                    </div>
                    
                    </div>
				</div>
			</div>
		</div>
	</div>
	
</body>
</html>

<script type="text/javascript">
$(function(){
	$('#send').on('mousedown',function(){
									$('#send').css('top','5px');
									console.log(1)
								})
								$('#send').on('mouseup',function(){
									$('#send').css('top','0px');
									console.log(2)
								})
	$('.js-tishi').on('click',function(){
		$('.js-tishi').css('display','none');
	})
	$('#send').on('click', function(event) {
		//标题
		if($('#title').val() == ''){
			$('.bt').text('请添加标题');
			//alert('请添加标题');
		return false;
		}else{
			$('.bt').text('');
		}

		//内容
		if($('#title').val() == ''){
			$('.nr').text('请添加内容');
		//	alert('请添加内容');
		return false;
		}else{
			$('.nr').text('');
		}
		
		$('#myform').submit();
	});

})
</script>